<template>
  <div>
      <div class="main">
        <div class="cinema-list">
          <div class="header">
            <div class="left">
              <div class="city" @click="tolist">
                <span>{{city}}</span>
                <img src="@/assets/down.png" alt="" width="6" height="3">
              </div>
            </div>
            <div class="title">
              <div>影院</div>
            </div>
            <div class="right">
              <div class="tosearch">
                <img src="@/assets/search.png" alt="" width="18" height="18">
              </div>
            </div>
          </div>
          <div class="cinema-list-tag">
            <div class="tag-name">
              <label >
                全城
                <img src="@/assets/down.png" alt="" width="6" height="3">
              </label>
              <label >
                APP订票
                <img src="@/assets/down.png" alt="" width="6" height="3">
              </label>
              <label >
                最近去过
                <img src="@/assets/down.png" alt="" width="6" height="3">
              </label>
            </div>
          </div>
          <div class="cinema-layer"></div>
          <div class="cinema-list-wrap">
            <ul class="cinema-list">
              <li class="cinema-list-item" v-for="item in list" :key="item.cinemaId" @click="goto(item.cinemaId)">
                <a href="javscript:;" class="cinema-item-wrap">
                  <div class="cinema-info-lt">
                    <span class="cinema-name">{{item.name}}</span>
                    <!-- <img src="@/assets/gone.png" alt="去过"> -->
                    <span class="cinema-address">{{item.address}}</span>
                  </div>
                  <div class="cinema-info-rt">
                    <div>
                      <span class="price-fmt">
                        <i>￥</i>
                        <span class="interge" style="font-size:15px">
                          {{item.lowPrice/100}}
                        </span>
                      </span>
                      <span class="upon">起</span>
                      </div>
                      <span class="gps-address">
                        <!-- <img src="@/assets/address.png" alt=""> -->
                        <strong>距离未知</strong>
                      </span>
                  </div>
                </a>
              </li>
            </ul>
          </div>
        </div>
      </div>
  </div>
</template>

<script>
import getLocation from '@/module/getlocation.js'
import {getCinemaInfo} from '@/api'
export default {
data() {
  return {
    city:'',
    list:[]
  }
},
computed: {
      cityid(){
          return this.$store.state.cityId
      }
    },
created() {
  this.position()
  this.getdata()
},
methods: {
   position(){
      getLocation(city=>{
        this.city = city.slice(0,2);
      })
    },
    getdata(){
      getCinemaInfo(this.cityid).then(res=>{
        this.list= res.data.data.cinemas
      })
      console.log(this.cityid)
    },
  goto(id){
    this.$router.push('/cinemasdetail/'+id)
  },
  tolist(){
    this.$router.push('/location')
  }

},
}
</script>

<style lang="scss" scoped>
*{margin: 0;
  padding: 0;
  box-sizing: border-box;
}
.main{
  height:100%;
  header>div[data-v-2475a5f8] {
    float: left;
    height: 44px;
  }
  .header{
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 44px;
      line-height: 44px;
      overflow: hidden;
      margin: 0;
      padding: 0;
      z-index: 2000;
      background-color: #fff;
      display: flex;
      .left{
        min-width: 15%;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        margin-left: 15px;
        .city{
          display: flex;
          align-items: center;
          span {
              display: inline-block;
              font-size: 13px;
              max-width: 58px;
              height: 16px;
              line-height: 16px;
              overflow: hidden;
              text-overflow: ellipsis;
              white-space: nowrap;
              padding-right: 5px;
              color: #191a1b;
          }
        }
          }
          img{
            vertical-align: middle;
          }
          .title{
            text-align: center;
            font-size: 17px;
            color: #191a1b;
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            div{
              color: #191a1b;
            }
          }
          .right{
            width: 15%;
            display: flex;
            justify-content: center;
            align-items: center;
            margin-right: 15px;
            div{
              width: 100%;
              text-align: right;
            }
          }
  }
  .header:after{
    content: " ";
    position: absolute;
    left: 0;
    bottom: 0;
    right: 0;
    height: 1px;
    border-bottom: 1px solid #ededed;
    color: #ededed;
    transform-origin: 0 100%;
    transform: scaleY(.5);
  }
  .cinema-list-tag {
    position: fixed;
    height: 50px;
    width: 100%;
    top: 44px;
    right: 0;
    text-align: center;
    background-color: #fff;
    z-index: 2000;
    .tag-name {
    position: relative;
    label {
    float: left;
    width: 33.3%;
    line-height: 49px;
    font-size: 14px;
    color: #191a1b;
    letter-spacing: -.2px;
    img {
    vertical-align: middle;
    padding-left: 2px;
        }
      }
    }
  }
  .cinema-layer{
    padding-top: 94px;
  }
  .cinema-list-wrap {
    padding-bottom: 49px;
    z-index: 100;
    ul {
    list-style: none;
    padding: 0;
    margin: 0;
    li {
    position: relative;
    background-color: #fff;
    padding: 15px;
    .cinema-item-wrap {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    outline: none;
    color: #333;
    text-decoration: none;
    .cinema-info-lt {
    width: calc(100% - 65px);
    text-align: left;
    padding-right: 15px;
    span {
    display: block;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
// img{
//   width: 32px;
//     height: 16.5px;
//     margin-bottom: -6px;
//     margin-left: 4px;
//     display: none;
// }
.cinema-address {
    color: #797d82;
    font-size: 12px;
    margin-top: 5px;
}
}
.cinema-name {
    color: #191a1b;
    font-size: 15px;
    // float: left;
}
.cinema-info-rt {
    width: 70px;
    text-align: center;
    float: right;
    margin-right: -5px;
    .price-fmt {
    font-size: 15px;
    color: #ff5f16;
    height: 0!important;
    display: inline-table!important;
    span {
    float: none!important;
}
i {
    font-size: 11px;
    font-style: normal;
}
}
.upon {
    color: #ff5f16;
    font-size: 10px;
}
.gps-address{
      display: block;
    font-size: 11px;
    color: #797d82;
    margin-top: 5px;
    strong {
    font-weight: 400;
    display: block;
    margin-top: 5px;
}
}
}
}
}
}
}
}
</style>